package easy

func NumJewelsInStones(jewels string, stones string) int {
	jewelsCount := 0
	for _, s := range stones {
		for _, j := range jewels {
			if s == j {
				jewelsCount++
				break
			}
		}
	}
	return jewelsCount
}

func NumJewelsInStones1(jewels string, stones string) int {
	jewelsCount := 0
	jewelsSet := map[byte]bool{}
	for i := range jewels {
		jewelsSet[jewels[i]] = true
	}
	for i := range stones {
		if jewelsSet[stones[i]] {
			jewelsCount++
		}
	}
	return jewelsCount
}
